#删除有序数组中的重复项
class Solution(object):
    def removeDuplicates(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        k = 1
        for i in range(1, len(nums)):

            if nums[i] != nums[i - 1]:
                nums[k] = nums[i]
                k += 1

        for i in range(k, len(nums)):
            nums[i] = '-'

        return k

nums = [2,2,3,4,4,4,5,6,6,7]
solution = Solution()
length = solution.removeDuplicates(nums)
print("不重复元素的数量:", length)
print("去重后的数组:", nums)